package server

import (
	"simple_game/app/server/actor"
	"simple_game/app/utils"
)

type Global struct {
	Actor *actor.Actor
}

func (g Global) Loader() {
}

func (g Global) Start() {
	actor.RegisterActor(g.Actor.Pid(), g)
	g.Actor.Start()
}

func (g Global) Stop() {
}

func init() {
	actor.RegisterInitActor(func() {
		uuid := utils.NewUid()
		globalActor := Global{
			Actor: actor.NewActor(uuid, nil),
		}
		globalActor.Start()
	})
}
